package srv

import (
	"context"
	"github.com/shinedone/srv-server/internal/client/data-adm/department"
	"github.com/shinedone/srv-server/internal/modules/enterprise/model"
)

type EnterpriseSrv struct {
	DepartmentClient *department.Client `inject:""`
}

func (s *EnterpriseSrv) GetByEnterpriseId(ctx context.Context, enterpriseId string) (string, error) {
	return "1", nil
}

func (s *EnterpriseSrv) List(ctx context.Context, query *ListQueryBo) ([]*model.Enterprise, error) {

	getDepartmentByIdResp, err := s.DepartmentClient.GetDepartmentByID(ctx, 2532002600262304860)
	if err != nil {
		return nil, err
	}

	return []*model.Enterprise{
		&model.Enterprise{
			EnterpriseId:   "dada",
			DepartmentName: getDepartmentByIdResp.DepartmentByPk.DepartmentID,
		},
	}, nil
}
